<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
 * languages
 * 
 * Detects all the available languages
 *
 * @author Simon Emms <simon@simonemms.com>
 */

$arrLanguages = array();

/* Detect the available languages - doesn't check everything is here though */
$path = FCPATH.APPPATH.'/language';

if(is_dir($path)) {
    if($handle = opendir($path)) {
        while(false !== ($entry = readdir($handle))) {
            /* Don't allow anything that's not in the format 'ab' or 'ab-cd' */
            if(!in_array($entry, $arrLanguages) && preg_match('/^(\w{2}(\-(\w{2}))?)$/', $entry)) {
                $arrLanguages[] = $entry;
            }
        }
    }
}

$config['languages'] = $arrLanguages;

/* Set the language - write in it's own language */
$config['lang_name'] = array(
    'de_lang' => 'Deutsch',
    'en_lang' => 'English',
    'en-gb_lang' => 'English (British)',
    'en-us_lang' => 'English (USA)',
    'fr_lang' => 'Français',
);

?>